/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: UserFactory
 * Author:   zhouheng
 * Date:     2018/7/10 20:58
 * Description: 用户工厂类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.hengby.hengcrud.modular.sys.factory;

import com.hengby.hengcrud.modular.sys.model.User;
import com.hengby.hengcrud.modular.sys.transfer.UserDto;
import org.springframework.beans.BeanUtils;

/**
 * 〈一句话功能简述〉<br> 
 * 〈用户工厂类〉
 *
 * @author zhouheng
 * @create 2018/7/10
 * @since 1.0.0
 */
public class UserFactory {
    public static User createUser(UserDto userDto){
        if(userDto == null){
            return null;
        }else{
            User user = new User();
            BeanUtils.copyProperties(userDto,user);
            return user;
        }
    }
}